<ion-view view-title="注册"  hide-tabs="true">
	<ion-nav-buttons side="right">
		<a class="button button-small button-clear button-stable" href="#/tab/login">登录 ></a>
	</ion-nav-buttons>
	<ion-content class="padding">
		<form name="theForm" novalidate="novalidate">
			<div class="list">
				<div class="row">
					<div class="col">
						<label class="item item-input">
							<span class="input-label">用户昵称</span>
							<input type="text" name="nickname" ng-model="register.nickname" placeholder="请填写用户昵称" required>
							<i ng-show="theForm.nickname.$valid" class="icon ion-checkmark-circled placeholder-icon"></i>
							<i ng-show="theForm.nickname.$invalid" class="icon ion-close-circled placeholder-icon"></i>
							&nbsp;&nbsp;&nbsp;&nbsp;
						</label>
					</div>
				</div>
				<div class="row">
					<div class="col">
						<label class="item item-input">
							<span class="input-label">手机号码</span>
							<input type="tel" name="mobile" ng-model="register.mobile" ng-pattern="/^1[1|3|4|5|7|8][0-9]\d{8}$/" placeholder="请填写手机号码" required>
							<i ng-show="theForm.mobile.$valid" class="icon ion-checkmark-circled placeholder-icon"></i>
							<i ng-show="theForm.mobile.$invalid" class="icon ion-close-circled placeholder-icon"></i>
							&nbsp;&nbsp;&nbsp;&nbsp;
						</label>
					</div>
				</div>
				<div class="row">
					<div class="col col-60">
						<label class="item item-input">
							<span class="input-label">验证码</span>
							<input type="tel" name="sms_code" ng-model="register.sms_code" ng-pattern="/^\d{6}$/" placeholder="请填写验证码" required>
							<i ng-show="theForm.sms_code.$valid" class="icon ion-checkmark-circled placeholder-icon"></i>
							<i ng-show="theForm.sms_code.$invalid" class="icon ion-close-circled placeholder-icon"></i>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</label>
					</div>
					<div class="col">
						<button class="button button-dark" button-widget="sms" ac="registerUser" mobile="{{register.mobile}}" ng-disabled="theForm.mobile.$invalid">
							获取短信验证码
						</button>
					</div>
				</div>
				<div class="row">
					<div class="col">
						<label class="item item-input">
							<span class="input-label">密码</span>
							<input type="password" name="password" ng-model="register.password" placeholder="请填写登录密码" required>
							<i ng-show="theForm.password.$valid" class="icon ion-checkmark-circled placeholder-icon"></i>
							<i ng-show="theForm.password.$invalid" class="icon ion-close-circled placeholder-icon"></i>
							&nbsp;&nbsp;&nbsp;&nbsp;
						</label>
					</div>
				</div>
				<div class="row">
					<div class="col">
						<label class="item item-input">
							<span class="input-label">确认密码</span>
							<input type="password" name="repassword" ng-model="register.repassword" placeholder="请重复登录密码" pw-check="password" required>
							<i ng-show="theForm.repassword.$valid" class="icon ion-checkmark-circled placeholder-icon"></i>
							<i ng-show="theForm.repassword.$invalid" class="icon ion-close-circled placeholder-icon"></i>
							&nbsp;&nbsp;&nbsp;&nbsp;
						</label>
					</div>
				</div>
			</div>
			<div class="list list-normal">
				<input type="checkbox" name="toggle" ng-model="register.toggle" ng-true-value="true"> 我已经阅读并同意  <a href="">《汪卡用户领用协议》</a>
			</div>
			<div class="row" ng-show="theForm.$invalid && !register.toggle">
				<div class="col">
					<div class="card">
						<div class="item item-divider">注册表单错误提示</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.nickname.$invalid && theForm.nickname.$error.required">
							<i class="icon ion-close-circled placeholder-icon"></i> 用户昵称必须填写!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.mobile.$invalid && theForm.mobile.$error.required">
							<i class="icon ion-close-circled placeholder-icon"></i> 手机号码必须填写!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.mobile.$dirty && theForm.mobile.$error.pattern">
							<i class="icon ion-close-circled placeholder-icon"></i> 手机号码格式错误!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.sms_code.$invalid && theForm.sms_code.$error.required">
							<i class="icon ion-close-circled placeholder-icon"></i> 验证码必须填写!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.sms_code.$dirty && theForm.sms_code.$error.pattern">
							<i class="icon ion-close-circled placeholder-icon"></i> 验证码格式错误!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.password.$invalid && theForm.password.$error.required">
							<i class="icon ion-close-circled placeholder-icon"></i> 用户密码必须填写!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.repassword.$invalid && theForm.repassword.$error.required">
							<i class="icon ion-close-circled placeholder-icon"></i> 重复密码必须填写!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="theForm.repassword.$dirty && theForm.repassword.$error.repeat">
							<i class="icon ion-close-circled placeholder-icon"></i> 两次输入的密码不一致!
						</div>
						<div class="item item-text-wrap item-icon-left assertive" ng-show="!register.toggle">
							<i class="icon ion-close-circled placeholder-icon"></i> 是否同意汪卡协议!
						</div>
					</div>
				</div>
			</div>
			<div class="list list-normal">
				<button class="button button-full button-energized" ng-click="submit()" ng-disabled="!theForm.$valid && !register.toggle">注册</button>
			</div>
			<p class="f12 graya">按注册按钮表明你已经同意<a href="">《汪卡用户领用协议》</a></p>
		</form>
	</ion-content>
</ion-view>